package com.hky.algorithm.mahjongGame;

import com.hky.algorithm.mahjongGame.constent.GangType;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.util.Objects;

/**
 * 杠牌的牌
 */
@NoArgsConstructor
@AllArgsConstructor
@ToString
public class GangItem {
    // 杠的牌
    public Card card;

    // 杠的类型
    public GangType type;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        GangItem gangItem = (GangItem) o;
        return Objects.equals(card, gangItem.card) && type == gangItem.type;
    }

    @Override
    public int hashCode() {
        return Objects.hash(card, type);
    }
}
